package com.sailfish.springbootdemo.service.db1;

import com.sailfish.springbootdemo.pojo.Result;
import com.sailfish.springbootdemo.pojo.db1.PcbaDeviceRelatedDeviceParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PcbaDeviceRelatedDeviceParamService {

    /**
     * 查询
     *
     * @param pcbaDeviceResourceId
     * @return
     */
    List<PcbaDeviceRelatedDeviceParam> getAllByDeviceResourceId(Integer pcbaDeviceResourceId);

    /**
     * 新增或者修改
     *
     * @param pcbaDeviceRelatedDeviceParam
     * @param mode
     * @return
     */
    Result addOrUpdateDeviceRelatedParam(PcbaDeviceRelatedDeviceParam pcbaDeviceRelatedDeviceParam, String mode);

    /**
     * 新增
     *
     * @param pcbaDeviceRelatedDeviceParam
     * @return
     */
    Boolean addDeviceRelatedParam(PcbaDeviceRelatedDeviceParam pcbaDeviceRelatedDeviceParam);

    /**
     * 更新
     *
     * @param pcbaDeviceRelatedDeviceParam
     * @return
     */
    Boolean updateDeviceRelatedParam(PcbaDeviceRelatedDeviceParam pcbaDeviceRelatedDeviceParam);

    /**
     * 根据 设备资源id + key 查询
     *
     * @param pcbaDeviceParamkey
     * @param pcbaDeviceResourceId
     * @return
     */
    Result getPcbaDeviceRelatedDeviceParamByKeyAndDeviceResourceId(String pcbaDeviceParamkey, Integer pcbaDeviceResourceId);

    /**
     * 得到最小的来自基线的值
     *
     * @param bindDeviceParamKey   此参数可能含有逗号, 需要分割处理
     * @param pcbaDeviceResourceId
     * @return
     */
    Result getMinimumValueFromBaseKeys(String bindDeviceParamKey, Integer pcbaDeviceResourceId);
}
